import json

import halogen

import sys
sys.path.insert(0, 'gen')
import hal
import samples


SAMPLES = [
    (hal.UserSchema, samples.USER),
    (hal.ClubSchema, samples.CLUB),
    (hal.HonorSchema, samples.HONOR),
    (hal.MemberSchema, samples.MEMBER),
    (hal.FollowerSchema, samples.FOLLOWER),
    (hal.LeagueSchema, samples.LEAGUE),
    (hal.TeamSchema, samples.TEAM),
    (hal.PlayerListSchema, samples.PLAYERLIST),
    (hal.MatchSchema, samples.MATCH),
    (hal.LineUpSchema, samples.LINEUP),
    (hal.EventSchema, samples.EVENT),
    (hal.SpiritBoradSchema, samples.SPIRITBORAD),
    (hal.TableSchema, samples.TABLE),
    (hal.SpiritSchema, samples.SPIRIT),
    (hal.RankSchema, samples.RANK),
    (hal.DistrictSchema, samples.DISTRICT),
]

for schema, data in SAMPLES:
    serialized = schema.serialize(data)
    j = json.dumps(serialized, indent=2)
    print(j)
